package com.ruoyi.email.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.email.domain.SysEmailMessage;
import com.ruoyi.email.mapper.SysEmailMessageMapper;
import com.ruoyi.email.service.ISysEmailMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 邮件消息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-11
 */
@Service
public class SysEmailMessageServiceImpl implements ISysEmailMessageService
{
    @Autowired
    private SysEmailMessageMapper sysEmailMessageMapper;

    /**
     * 查询邮件消息
     * 
     * @param id 邮件消息主键
     * @return 邮件消息
     */
    @Override
    public SysEmailMessage selectSysEmailMessageById(Long id)
    {
        return sysEmailMessageMapper.selectSysEmailMessageById(id);
    }

    /**
     * 查询邮件消息列表
     * 
     * @param sysEmailMessage 邮件消息
     * @return 邮件消息
     */
    @Override
    public List<SysEmailMessage> selectSysEmailMessageList(SysEmailMessage sysEmailMessage)
    {
        return sysEmailMessageMapper.selectSysEmailMessageList(sysEmailMessage);
    }

    /**
     * 新增邮件消息
     * 
     * @param sysEmailMessage 邮件消息
     * @return 结果
     */
    @Override
    public int insertSysEmailMessage(SysEmailMessage sysEmailMessage)
    {
        sysEmailMessage.setCreateTime(DateUtils.getNowDate());
        return sysEmailMessageMapper.insertSysEmailMessage(sysEmailMessage);
    }

    /**
     * 修改邮件消息
     * 
     * @param sysEmailMessage 邮件消息
     * @return 结果
     */
    @Override
    public int updateSysEmailMessage(SysEmailMessage sysEmailMessage)
    {
        return sysEmailMessageMapper.updateSysEmailMessage(sysEmailMessage);
    }

    /**
     * 批量删除邮件消息
     * 
     * @param ids 需要删除的邮件消息主键
     * @return 结果
     */
    @Override
    public int deleteSysEmailMessageByIds(Long[] ids)
    {
        return sysEmailMessageMapper.deleteSysEmailMessageByIds(ids);
    }

    /**
     * 删除邮件消息信息
     * 
     * @param id 邮件消息主键
     * @return 结果
     */
    @Override
    public int deleteSysEmailMessageById(Long id)
    {
        return sysEmailMessageMapper.deleteSysEmailMessageById(id);
    }
}
